<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
.result
{
background-color:#999999;
text-shadow:#666666;
font-family:Arial, Helvetica, sans-serif;
font-size:18px;
}
.valor
{
background-color:#999999;
text-shadow:#ffffff;
font-family:Arial, Helvetica, sans-serif;
font-size:16px;
}
</style>
</head>

<body>
<?php
ini_set("display_errors",true);
include("admin/con_.php");
$sql = "select me.co_exameseq,ma.registro,mp.nome,me.co_exame,me.co_metodo,
r.sequencia_repeticao,e.data_liberacao,e.hora_liberacao,r.parametro,r.resultado 
from historico.mlis_amostra ma 
left join historico.mlis_paciente mp on (ma.registro=mp.registro)
inner join historico.mlis_exame me on (me.co_amostra=ma.amostra)
inner join historico.mconnect_exame e on (e.exame=me.co_examemetodo and e.amostra=me.co_amostra)
inner join historico.mconnect_resultado r on (e.exame=r.exame and e.amostra=r.amostra and r.sequencia_repeticao=me.repeticao)
where me.status='R'  limit 100";
$res=pg_query($con,$sql);
while($registro=pg_fetch_assoc($res))
{
switch($registro['parametro'])
{
	case 'RESULT':	echo "<div class='result'>$registro[nome] - $registro[co_exame] - $registro[parametro] - $registro[resultado]</div>";
					break;
	case 'VALOR':	echo "<div class='valor'>$registro[nome] - $registro[co_exame] - $registro[parametro] - $registro[resultado]</div>";
					break;					
//	default:	echo "<div class='extra'>$registro[nome] - $registro[co_exame] - $registro[parametro] - $registro[resultado]</div>";
			//		break;
					
	}
}
?>
</body>
</html>
